import 'package:data/response/project_response.dart' hide Project;
import 'package:domain/model/projects_domain_model.dart';

extension ProjectsDomainModelMapper on ProjectResponse {
  ProjectsDomainModel toDomainModel() {
    final result = projects
        .map(
          (item) => Project(
            title: item.title,
            desc: item.desc,
            link: item.link,
            niceDate: item.niceDate,
            chapterId: item.chapterId,
          ),
        )
        .toList();

    return ProjectsDomainModel(totalCount: total, projects: result);
  }
}
